package com.ruoyi.system.utils;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

public class DateTimeConverter {
    public static Date convertToDate(LocalDateTime localDateTime) {
        return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
    }
    
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        Date date = convertToDate(now);
        System.out.println("LocalDateTime: " + now);
        System.out.println("Converted Date: " + date);
    }
}